<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <el-button @click="fn">添加</el-button>
    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
      Vue.component('el-button',{
        template:`
          <div>
            <button @click="$emit('click')">
              <slot></slot>
            </button>
          </div>
        `
      })
      var vm = new Vue({
        el: '#app',
        data: {},
        methods: {
          fn(){
            console.log(123)
          }
        },
      })
    </script>
  </body>
</html>
